#!/usr/local/bin/ruby

require 'mysql'

def get_merchant_id(merchant_name) 
begin
    con = Mysql.new 'qadailytest', 'development', 'paymenow'
    queryString = "select mid from Merchant where displayName like \'%#{merchant_name}%\'"
    rs = con.query 'use development_db'
    rs = con.query queryString
    rs.fetch_row[0].to_i
rescue Mysql::Error => e
    puts e.errno
    puts e.error
ensure
    con.close if con
end
end

